<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title>文件上传</title>
	<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
	<script src="https://zwgt-cache.oss-cn-hangzhou.aliyuncs.com/static/h5/js/NativeShare.js"></script>
	{js href="https://zwgt-cache.oss-cn-hangzhou.aliyuncs.com/static/home/js/jquery.js" /}

</head>
<style>
*{
	margin: 0;
}
ul,ol,li {
	list-style: none;
	margin: 0 0;
	padding: 0 0;
}
body {
	background: #eee;
	font-family: SimSun, Helvetica, Arial, sans-serif;
	font-size: 14px;
	color:#000;
	margin: 0;
	padding: 0;
}
p{
	color: #fff;
	text-align: center;
}
.alertDark{
	width: 150px;
	min-height: 22px;
	border-radius: 8px;
	color: #fff;
	font-size: 14px;
	line-height: 20px;
	text-align: center;
	padding: 12px 10px;
	background-color: rgba(0, 0, 0, 0.75);
	position: fixed;
	left: 50%;
	top: 50%;
	margin-left: -75px;
	z-index: 100;
}
.user-pact{
	margin: 15px auto 0;
	color: #fff;
	font-size: 12px;
	line-height: 25px;
	height: 25px;
	text-align: center;
}
.user-pact i{
	margin-right: 0px;
	margin-left: 7px;
	display: inline-block;
}
.user-pact i img{
	width: 12px;
	margin-right: 2px;
	margin-bottom: -2px;
}
.user-pact a{
	color: #fff;
}
.login{
	width: 90%;
	margin: 0 auto;
	height: 25px;
	line-height: 25px;
	font-size: 12px;
}
.login a{
	float: right;
	color: #fff;
}
.con{
	width: 100%;
	height: 100vh;
	background: url('/static/img/img_bg.png');
	background-size: 100% 100%;
}
.name{
	width: 100%;
	height: 20vh;
	padding-top: 20vh;
}
.name img{
	display: inherit;
	width: 40%;
	min-width: 300px;
	margin: auto;
}
.form{
	width: calc(28% - 50px);
	height: calc(18vw - 50px);
	min-width: 250px;
	min-height: 130px;
	margin: 2vh auto;
	padding:25px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 10px;
}
.part{
	width: 100%;

}
.avatar{
	width: 35%;
	border: 2px solid white;
	border-radius: 5px;
}
.input_box{
	width: 55%;
	float: right;
}
.bg_w{
	width: 100%;
	height: 5vh;
	min-height: 33px;
	border: 0px;
	padding-left: 10px;
	border-radius: 3px;
	background: white;
}
.input{
	width: 100%;
	height: 4.5vh;
	min-height: 31px;
	border: 0px;
	border-radius: 3px;
	outline:none;
	cursor: pointer;
	color: #0f9ad6;
	font-size: 16px;
}
input::-webkit-input-placeholder {
	/* placeholder颜色  */
	color: #0f9ad6;
	/* placeholder字体大小  */
	font-size: 10px;
	/* placeholder位置  */
	text-align: left;
}
.button{
	width: 40%;
	margin: 5vh auto 0 auto;
	background: white;
	text-align: center;
	color: #0f9ad6;
	font-size: 14px;
	line-height: 28px;
	border-radius: 50px;
	box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.37);
	-moz-user-select: -moz-none;
	-khtml-user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
.button:hover{
	box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.57);
}
.button:active{
	box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.57);
}
input:focus
{ 
	
}
</style>
<body>
	<div class="con">
		<div class="name">
			<img src="/static/img/img_part_1.png" alt="">
		</div>
		<div class="form">
			<div class="part">
				<img src="/static/img/img_head.png" alt="" class="avatar">
				<div class="input_box">
					<div class="bg_w" style="margin-top: 5px;">
						<input type="text" class="input"   placeholder="请输入账号" id="user">
					</div>
					<div class="bg_w" style="margin-top: 2vw;">
						<input type="password" class="input"  placeholder="请输入密码" id="password">
					</div>
					
				</div>
				<div class="button" id="button">登录</div>
			</div>
			
		</div>
		<div class="alertDark J_alertTip" style="display:none;"></div>
		<script type="text/javascript" src="https://zwgt-cache.oss-cn-hangzhou.aliyuncs.com/static/h5/js/zepto.js"></script>
		<script type="text/javascript" src="https://zwgt-cache.oss-cn-hangzhou.aliyuncs.com/static/h5/js/md5.min.js"></script>
	</div>



<!-- <h2>文件上传</h2>
<FORM method="post" enctype="multipart/form-data" class="form" action="{:url('upload')}">选择文件：
  <INPUT type="file" class="files" name="files"><br/>
  <INPUT type="submit" class="btn" value=" 提交 ">
  <span>测试111</span>
</FORM> -->
</body>
<script>

	var API_ROOT = {
		Host: location.protocol + "//" + window.location.host
	};
	Infs = {
		login:{
			url:API_ROOT.Host+"/index/index/index", //登陆
			type:"post"
		},
		user:{
			url:API_ROOT.Host+"/index/user/index"//本页url
		}
	};
	function alertDark(e){
		$('.J_alertTip').show();
		$('.J_alertTip').html(e);
		setTimeout("$('.J_alertTip').hide(300)",2000);
	}//移除读取缓冲动画
	//登陆
	$("#button").on('click', function(){   

		var mob = $.trim($('#user').val());//手机号码
		var pwd = $.trim($("#password").val());//密码
		//手机号码是否空
		if(mob == '') {
			console.log('000')
			alertDark('请先输入手机号码');
			$('#password').focus();
			return false;
		}
		//验证手机号正确性
		var pattern = /^1[34578]\d{9}$/; 
		if(!pattern.test(mob)) {
			alertDark('请输入正确的手机号码');
			$('#password').focus();
			return false;
		}
		if(pwd == '') {
			alertDark('请输入您的密码');
			$('#password').focus();
			return false;
		}
		if(pwd.length < 6) {
			alertDark('密码长度不小于6位');
			$('#password').focus();
			return false;
		}        
		var param = {"phone":mob,"passwd":pwd}; 
		console.log(param)
		$.ajax({
			url: Infs.login.url,
			type: Infs.login.type,
			data: param,
			success: function (res) {

				console.log(res);           				
				if(res.code == "1") {
					window.location.href = Infs.user.url;
				}else{
					alertDark(res.msg);
				}
			}
		});
	})
	//扩展方法获取url参数
	function getUrlParam(name) {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
		var r = window.location.search.substr(1).match(reg);
		if (r != null) return unescape(r[2]); return null;
	}    
	function getlocalStorage(g_name){
		localStorage.getItem(g_name);
	}   	

</script>
</html>